using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Reflection;
using System.Text;
using System.Windows.Forms;

namespace HandyIRCChat
{
    public partial class OptionsForm : Form
    {
        private Options options;

        private OptionsDescriptorWrapper optionsDescriptorWrapper;

        public OptionsForm(Options opt)
        {
            options = opt;
            optionsDescriptorWrapper = new OptionsDescriptorWrapper(options);

            InitializeComponent();
            CustomInitializeComponent();
        }

        private void CustomInitializeComponent()
        {
            propertyGrid.SelectedObject = optionsDescriptorWrapper;
        }

        private void okButton_Click(object sender, EventArgs e)
        {
            options = optionsDescriptorWrapper.OptionsInstance;

            this.DialogResult = DialogResult.OK;
        }

        private void cancelButton_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
        }
    }
}